﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BadHabit.Factory.Controls {
    /// <summary>
    /// Interaction logic for RiskPanel.xaml
    /// </summary>
    public partial class RiskPanel : GenericPanel {

        public RiskPanel() {
            InitializeComponent();
        }

        private void riskDataGrid_InitializingNewItem(object sender, Microsoft.Windows.Controls.InitializingNewItemEventArgs e) {
            Data.ProjectDataSet.RiskRow riskRow = Helper.GetRowFromRowView<Data.ProjectDataSet.RiskRow>(e.NewItem);
            if (riskRow == null)
                return;
            riskRow.RiskName = Properties.Resources.New_risk;
            riskRow.Impact = (short)RiskImpact.LOW;
            riskRow.Probability = (short)RiskProbability.LOW;
            riskRow.PreviousBaselineProbability = (short)RiskProbability.NONE;
        }

    }
}
